# create by fanfan on 2020/3/27 0027
from keras.callbacks import EarlyStopping
early_stopping = EarlyStopping(monitor='val_loss',patience=2)
model.fit(x,y,validation_split=0.2,callbacks=[early_stopping])